package com.nuoniu.sibanyun.mapper.production;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.production.ErpMrpRecord;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * mrp运算记录 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2021-03-16
 */
public interface ErpMrpRecordMapper extends BaseMapper<ErpMrpRecord> {

    @Select("select code from ma_mrp_oper_record where company_id=#{companyId} and date_format(create_date, #{dateStr})=date_format(now(), #{dateStr}) order by create_date desc limit 1")
    String getNewestCode(Integer companyId, String dateStr);
}
